﻿using System.IO;
using Web.UI.AdminLTE.Enums;

namespace Web.UI.AdminLTE.Controls.Widget
{
    public class BoxHeaderPanel : BoxSectionPanel
    {
        private readonly Box _box;

        internal BoxHeaderPanel(Box box, BoxHeader boxHeader, TextWriter writer)
            : base(BoxSection.Header, writer)
        {
            _box = box;
            TextWriter.Write(boxHeader);
        }

        public void BoxTools(BootstrapSize buttonSize = BootstrapSize.Small, bool closable = false,
            bool collapsible = false)
        {
            using (BeginBoxTools(buttonSize, closable, collapsible))
            {
                // NOP 
            }
        }

        public BoxToolsPanel BeginBoxTools(BootstrapSize buttonSize = BootstrapSize.Small, bool closable = false,
            bool collapsible = false)
        {
            return new BoxToolsPanel(_box, TextWriter, buttonSize).Closable(closable).Collapsible(collapsible);
        }
    }
}